package networkTCPIP;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 10005);
        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("hello,WHB".getBytes());
        //接收服务器端的反馈
        InputStream inputStream = socket.getInputStream();
        //解析数据并输出
        byte[] bytes = new byte[1024];
        int len = inputStream.read(bytes);
        String s = new String(bytes, 0, len);
        System.out.println("s = " + s);

    }
}
